/**
  ******************************************************************************
  * @file    WIFI_Driver.h
  * @author  tuancheng_Zero
  * @version V0.1
  * @date    08/05/2024
  * @brief   WIFI Module Drive
  ******************************************************************************
*/
#ifndef	__GLOBALS_NETWORK_WIFI_DRIVER_H_
#define	__GLOBALS_NETWORK_WIFI_DRIVER_H_

#define DMARxBuffer              1024    //dma接收缓存

#define WIFI_RST_GPIO            GPIOC
#define WIFI_RST_Pin             GPIO_PIN_7
#define WIFI_RST_LOW()           GPIO_SetBits(WIFI_RST_GPIO, WIFI_RST_Pin)
#define WIFI_RST_HIGH()          GPIO_ResetBits(WIFI_RST_GPIO, WIFI_RST_Pin)

#define USARTx_IRQn              USART2_IRQn
#define USARTx_IRQHandler 		 USART2_IRQHandler

#define USARTy                   USART2
#define USARTy_GPIO              GPIOC
#define USARTy_CLK               RCC_APB1_PERIPH_USART2
#define USARTy_GPIO_CLK          RCC_APB2_PERIPH_GPIOC
#define USARTy_RxPin             GPIO_PIN_9
#define USARTy_TxPin             GPIO_PIN_8
#define USARTy_IRQn              USART2_IRQn
#define USARTy_DMA_DR_Base       ((uint32_t)&USART2->DAT)
#define USARTy_Remap             GPIO_RMP2_USART2

#define USARTy_DMA_Rx_IRQn       DMA1_Channel6_IRQn
#define USARTy_DMA_Tx_IRQn       DMA1_Channel7_IRQn
#define USARTy_Tx_DMA_Channel    DMA1_CH7
#define USARTy_Tx_DMA_FLAG       (DMA1_FLAG_GL7|DMA1_FLAG_TC7|DMA1_FLAG_TE7|DMA1_FLAG_HT7)
#define USARTy_Rx_DMA_Channel    DMA1_CH6
#define USARTy_Rx_DMA_FLAG       (DMA1_FLAG_GL6|DMA1_FLAG_TC6|DMA1_FLAG_TE6|DMA1_FLAG_HT6)  
#define USARTy_Tx_DMA_Function   DMA1_Channel7_IRQHandler
#define USARTy_Rx_DMA_Function   DMA1_Channel6_IRQHandler


#define WIFIRXDMA_IRQPrePrio                 0x03
#define WIFIRXDMA_IRQSubPrio                 0x02

#define WIFITXDMA_IRQPrePrio                 0x03
#define WIFITXDMA_IRQSubPrio                 0x01

void GPRS_DRIVER_SetATs(u32 BaudRate);
#endif